package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.net.domain.BusiSrtpRouteListVoTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiSrtpRouteTableMapper;
import com.ruoyi.net.domain.BusiSrtpRouteTable;
import com.ruoyi.net.service.IBusiSrtpRouteTableService;

/**
 * 业务-srtp路由Service业务层处理
 * 
 * @author net
 * @date 2024-12-25
 */
@Service
public class BusiSrtpRouteTableServiceImpl implements IBusiSrtpRouteTableService 
{
    @Autowired
    private BusiSrtpRouteTableMapper busiSrtpRouteTableMapper;

    /**
     * 查询业务-srtp路由
     * 
     * @param id 业务-srtp路由主键
     * @return 业务-srtp路由
     */
    @Override
    public BusiSrtpRouteTable selectBusiSrtpRouteTableById(String id)
    {
        return busiSrtpRouteTableMapper.selectBusiSrtpRouteTableById(id);
    }

    /**
     * 查询业务-srtp路由列表
     * 
     * @param busiSrtpRouteTable 业务-srtp路由
     * @return 业务-srtp路由
     */
    @Override
    public List<BusiSrtpRouteListVoTable> selectBusiSrtpRouteTableList(BusiSrtpRouteTable busiSrtpRouteTable)
    {
        return busiSrtpRouteTableMapper.selectBusiSrtpRouteTableList(busiSrtpRouteTable);
    }

    /**
     * 新增业务-srtp路由
     * 
     * @param busiSrtpRouteTable 业务-srtp路由
     * @return 结果
     */
    @Override
    public int insertBusiSrtpRouteTable(BusiSrtpRouteTable busiSrtpRouteTable)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiSrtpRouteTable.getId())) {
            busiSrtpRouteTable.setId(uuid);
        }
        busiSrtpRouteTable.setCreateBy(SecurityUtils.getUsername());
        busiSrtpRouteTable.setCreateTime(DateUtils.getNowDate());
        busiSrtpRouteTable.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpRouteTable.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpRouteTableMapper.insertBusiSrtpRouteTable(busiSrtpRouteTable);
    }

    /**
     * 修改业务-srtp路由
     * 
     * @param busiSrtpRouteTable 业务-srtp路由
     * @return 结果
     */
    @Override
    public int updateBusiSrtpRouteTable(BusiSrtpRouteTable busiSrtpRouteTable)
    {
        busiSrtpRouteTable.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpRouteTable.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpRouteTableMapper.updateBusiSrtpRouteTable(busiSrtpRouteTable);
    }

    /**
     * 批量删除业务-srtp路由
     * 
     * @param ids 需要删除的业务-srtp路由主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpRouteTableByIds(String[] ids)
    {
        return busiSrtpRouteTableMapper.deleteBusiSrtpRouteTableByIds(ids);
    }

    /**
     * 删除业务-srtp路由信息
     * 
     * @param id 业务-srtp路由主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpRouteTableById(String id)
    {
        return busiSrtpRouteTableMapper.deleteBusiSrtpRouteTableById(id);
    }
}
